import smtplib, sys


smtpObj = smtplib.SMTP('smtp.qq.com', 25)
type(smtpObj)

print(smtpObj.ehlo('hello'))

mailAddress='836491384@qq.com'
# 授权码
password='wlcfnoewxzuebbgi'

smtpObj.login(mailAddress, password)
smtpObj.sendmail(mailAddress, 'indexman@126.com', 'Subject: God bless you. \n Long time no see, bro. Hope you will be '
                                                  'a great man.')

print(smtpObj.quit())
